{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "51466c8d-8ce4-4b3d-be4e-18fdbeda5f53",
   "metadata": {},
   "source": [
    "# Chat Agent Executor\n",
    "\n",
    "In this example we will build a chat executor that uses function calling from\n",
    "scratch."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7cbd446a-808f-4394-be92-d45ab818953c",
   "metadata": {},
   "source": [
    "## Setup¶\n",
    "\n",
    "First we need to install the packages required\n",
    "\n",
    "```bash\n",
    "yarn add langchain @langchain/openai @langchain/langgraph\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0abe11f4-62ed-4dc4-8875-3db21e260d1d",
   "metadata": {},
   "source": [
    "Next, we need to set API keys for OpenAI (the LLM we will use) and Tavily (the\n",
    "search tool we will use)\n",
    "\n",
    "```bash\n",
    "export OPENAI_API_KEY=\n",
    "export TAVILY_API_KEY=\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f0ed46a8-effe-4596-b0e1-a6a29ee16f5c",
   "metadata": {},
   "source": [
    "Optionally, we can set API key for\n",
    "[LangSmith tracing](https://smith.langchain.com/), which will give us\n",
    "best-in-class observability.\n",
    "\n",
    "```bash\n",
    "export LANGCHAIN_TRACING_V2=true\n",
    "export LANGCHAIN_API_KEY=\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "21ac643b-cb06-4724-a80c-2862ba4773f1",
   "metadata": {},
   "source": [
    "## Set up the tools\n",
    "\n",
    "We will first define the tools we want to use. For this simple example, we will use a built-in search tool via Tavily. However, it is really easy to create your own tools - see documentation [here](https://js.langchain.com/docs/how_to/custom_tools/) on how to do that.\n",
    "\n",
    "After defining our tools, we can wrap them in a simple `ToolExecutor`. This is a real simple\n",
    "class that takes in a `ToolInvocation` and calls that tool, returning the output.\n",
    "\n",
    "A ToolInvocation is any type with `tool` and `toolInput` attribute."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "5cf3331e-ccb3-41c8-aeb9-a840a94d41e7",
   "metadata": {},
   "outputs": [],
   "source": [
    "import { ToolExecutor } from \"@langchain/langgraph/prebuilt\";\n",
    "import { TavilySearchResults } from \"@langchain/community/tools/tavily_search\";\n",
    "\n",
    "const tools = [new TavilySearchResults({ maxResults: 1 })];\n",
    "\n",
    "const toolExecutor = new ToolExecutor({\n",
    "  tools,\n",
    "});"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5497ed70-fce3-47f1-9cad-46f912bad6a5",
   "metadata": {},
   "source": [
    "## Set up the model\n",
    "\n",
    "Now we need to load the chat model we want to use. Importantly, this should\n",
    "satisfy two criteria:\n",
    "\n",
    "1. It should work with messages. We will represent all agent state in the form\n",
    "   of messages, so it needs to be able to work well with them.\n",
    "2. It should work with OpenAI function calling. This means it should either be\n",
    "   an OpenAI model or a model that exposes a similar interface.\n",
    "\n",
    "Note: these model requirements are not requirements for using LangGraph - they\n",
    "are just requirements for this one example."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "892b54b9-75f0-4804-9ed0-88b5e5532989",
   "metadata": {},
   "outputs": [],
   "source": [
    "import { ChatOpenAI } from \"@langchain/openai\";\n",
    "\n",
    "// We will set streaming=True so that we can stream tokens\n",
    "// See the streaming section for more information on this.\n",
    "const model = new ChatOpenAI({\n",
    "  temperature: 0,\n",
    "  streaming: true,\n",
    "});"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a77995c0-bae2-4cee-a036-8688a90f05b9",
   "metadata": {},
   "source": [
    "After we've done this, we should make sure the model knows that it has these\n",
    "tools available to call. We can do this by converting the LangChain tools into\n",
    "the format for OpenAI function calling, and then bind them to the model class."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "cd3cbae5-d92c-4559-a4aa-44721b80d107",
   "metadata": {},
   "outputs": [],
   "source": [
    "import { convertToOpenAIFunction } from \"@langchain/core/utils/function_calling\";\n",
    "\n",
    "const toolsAsOpenAIFunctions = tools.map((tool) =>\n",
    "  convertToOpenAIFunction(tool)\n",
    ");\n",
    "const newModel = model.bind({\n",
    "  functions: toolsAsOpenAIFunctions,\n",
    "});"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8e8b9211-93d0-4ad5-aa7a-9c09099c53ff",
   "metadata": {},
   "source": [
    "### Define the agent state\n",
    "\n",
    "The main type of graph in `langgraph` is the `StatefulGraph`. This graph is\n",
    "parameterized by a state object that it passes around to each node. Each node\n",
    "then returns operations to update that state. These operations can either SET\n",
    "specific attributes on the state (e.g. overwrite the existing values) or ADD to\n",
    "the existing attribute. Whether to set or add is denoted by annotating the state\n",
    "object you construct the graph with.\n",
    "\n",
    "For this example, the state we will track will just be a list of messages. We\n",
    "want each node to just add messages to that list. To do this, we define our state via the `Annotation` function, with a single attribute `messages` that is a list of `BaseMessage`s. The value of our attribute `messages` is another `Annotation` which has two sub-attributes: `reducer` and `default`. The `reducer` key must be a factory that returns a function that takes the current value of the attribute and the new value to add, and returns the new value of the attribute."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "ea793afa-2eab-4901-910d-6eed90cd6564",
   "metadata": {},
   "outputs": [],
   "source": [
    "import { BaseMessage } from \"@langchain/core/messages\";\n",
    "import { Annotation } from \"@langchain/langgraph\";\n",
    "\n",
    "const AgentState = Annotation.Root({\n",
    "  messages: Annotation<BaseMessage[]>({\n",
    "    reducer: (x, y) => x.concat(y),\n",
    "  })\n",
    "})"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e03c5094-9297-4d19-a04e-3eedc75cefb4",
   "metadata": {},
   "source": [
    "## Define the nodes\n",
    "\n",
    "We now need to define a few different nodes in our graph. In `langgraph`, a node\n",
    "can be either a function or a\n",
    "[runnable](https://js.langchain.com/docs/expression_language/). There are two\n",
    "main nodes we need for this:\n",
    "\n",
    "1. The agent: responsible for deciding what (if any) actions to take.\n",
    "2. A function to invoke tools: if the agent decides to take an action, this node\n",
    "   will then execute that action.\n",
    "\n",
    "We will also need to define some edges. Some of these edges may be conditional.\n",
    "The reason they are conditional is that based on the output of a node, one of\n",
    "several paths may be taken. The path that is taken is not known until that node\n",
    "is run (the LLM decides).\n",
    "\n",
    "1. Conditional Edge: after the agent is called, we should either: a. If the\n",
    "   agent said to take an action, then the function to invoke tools should be\n",
    "   called b. If the agent said that it was finished, then it should finish\n",
    "2. Normal Edge: after the tools are invoked, it should always go back to the\n",
    "   agent to decide what to do next\n",
    "\n",
    "Let's define the nodes, as well as a function to decide how what conditional\n",
    "edge to take."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "3b541bb9-900c-40d0-964d-7b5dfee30667",
   "metadata": {},
   "outputs": [],
   "source": [
    "import { FunctionMessage } from \"@langchain/core/messages\";\n",
    "import { AgentAction } from \"@langchain/core/agents\";\n",
    "\n",
    "// Define the function that determines whether to continue or not\n",
    "const shouldContinue = (state: typeof AgentState.State) => {\n",
    "  const { messages } = state;\n",
    "  const lastMessage = messages[messages.length - 1];\n",
    "  // If there is no function call, then we finish\n",
    "  if (\n",
    "    !(\"function_call\" in lastMessage.additional_kwargs) ||\n",
    "    !lastMessage.additional_kwargs.function_call\n",
    "  ) {\n",
    "    return \"end\";\n",
    "  }\n",
    "  // Otherwise if there is, we continue\n",
    "  return \"continue\";\n",
    "};\n",
    "\n",
    "// Define the function to execute tools\n",
    "const _getAction = (state: typeof AgentState.State): AgentAction => {\n",
    "  const { messages } = state;\n",
    "  // Based on the continue condition\n",
    "  // we know the last message involves a function call\n",
    "  const lastMessage = messages[messages.length - 1];\n",
    "  if (!lastMessage) {\n",
    "    throw new Error(\"No messages found.\");\n",
    "  }\n",
    "  if (!lastMessage.additional_kwargs.function_call) {\n",
    "    throw new Error(\"No function call found in message.\");\n",
    "  }\n",
    "  // We construct an AgentAction from the function_call\n",
    "  return {\n",
    "    tool: lastMessage.additional_kwargs.function_call.name,\n",
    "    toolInput: JSON.stringify(\n",
    "      lastMessage.additional_kwargs.function_call.arguments,\n",
    "    ),\n",
    "    log: \"\",\n",
    "  };\n",
    "};\n",
    "\n",
    "// Define the function that calls the model\n",
    "const callModel = async (state: typeof AgentState.State) => {\n",
    "  const { messages } = state;\n",
    "  const response = await newModel.invoke(messages);\n",
    "  // We return a list, because this will get added to the existing list\n",
    "  return {\n",
    "    messages: [response],\n",
    "  };\n",
    "};\n",
    "\n",
    "const callTool = async (state: typeof AgentState.State) => {\n",
    "  const action = _getAction(state);\n",
    "  // We call the tool_executor and get back a response\n",
    "  const response = await toolExecutor.invoke(action);\n",
    "  // We use the response to create a FunctionMessage\n",
    "  const functionMessage = new FunctionMessage({\n",
    "    content: response,\n",
    "    name: action.tool,\n",
    "  });\n",
    "  // We return a list, because this will get added to the existing list\n",
    "  return { messages: [functionMessage] };\n",
    "};"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ffd6e892-946c-4899-8cc0-7c9291c1f73b",
   "metadata": {},
   "source": [
    "## Define the graph\n",
    "\n",
    "We can now put it all together and define the graph!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "813ae66c-3b58-4283-a02a-36da72a2ab90",
   "metadata": {},
   "outputs": [],
   "source": [
    "import { END, START, StateGraph } from \"@langchain/langgraph\";\n",
    "\n",
    "// Define a new graph\n",
    "const workflow = new StateGraph(AgentState)\n",
    "  // Define the two nodes we will cycle between\n",
    "  .addNode(\"agent\", callModel)\n",
    "  .addNode(\"action\", callTool)\n",
    "  // Set the entrypoint as `agent`\n",
    "  // This means that this node is the first one called\n",
    "  .addEdge(START, \"agent\")\n",
    "  // We now add a conditional edge\n",
    "  .addConditionalEdges(\n",
    "    // First, we define the start node. We use `agent`.\n",
    "    // This means these are the edges taken after the `agent` node is called.\n",
    "    \"agent\",\n",
    "    // Next, we pass in the function that will determine which node is called next.\n",
    "    shouldContinue,\n",
    "    // Finally we pass in a mapping.\n",
    "    // The keys are strings, and the values are other nodes.\n",
    "    // END is a special node marking that the graph should finish.\n",
    "    // What will happen is we will call `should_continue`, and then the output of that\n",
    "    // will be matched against the keys in this mapping.\n",
    "    // Based on which one it matches, that node will then be called.\n",
    "    {\n",
    "      // If `tools`, then we call the tool node.\n",
    "      continue: \"action\",\n",
    "      // Otherwise we finish.\n",
    "      end: END,\n",
    "    },\n",
    "  )\n",
    "  // We now add a normal edge from `tools` to `agent`.\n",
    "  // This means that after `tools` is called, `agent` node is called next.\n",
    "  .addEdge(\"action\", \"agent\");\n",
    "\n",
    "// Finally, we compile it!\n",
    "// This compiles it into a LangChain Runnable,\n",
    "// meaning you can use it as you would any other runnable\n",
    "const app = workflow.compile();"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "547c3931-3dae-4281-ad4e-4b51305594d4",
   "metadata": {},
   "source": [
    "## Use it!\n",
    "\n",
    "We can now use it! This now exposes the\n",
    "[same interface](https://python.langchain.com/docs/expression_language/) as all\n",
    "other LangChain runnables."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "8edb04b9-40b6-46f1-a7a8-4b2d8aba7752",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\n",
      "  messages: [\n",
      "    HumanMessage {\n",
      "      \"content\": \"what is the weather in sf\",\n",
      "      \"additional_kwargs\": {},\n",
      "      \"response_metadata\": {}\n",
      "    },\n",
      "    AIMessageChunk {\n",
      "      \"id\": \"chatcmpl-9y3695OyrZqhRmcbVkioOxXzjXp32\",\n",
      "      \"content\": \"\",\n",
      "      \"additional_kwargs\": {\n",
      "        \"function_call\": {\n",
      "          \"name\": \"tavily_search_results_json\",\n",
      "          \"arguments\": \"{\\\"input\\\":\\\"weather in San Francisco\\\"}\"\n",
      "        }\n",
      "      },\n",
      "      \"response_metadata\": {\n",
      "        \"estimatedTokenUsage\": {\n",
      "          \"promptTokens\": 80,\n",
      "          \"completionTokens\": 21,\n",
      "          \"totalTokens\": 101\n",
      "        },\n",
      "        \"prompt\": 0,\n",
      "        \"completion\": 0,\n",
      "        \"finish_reason\": \"function_call\",\n",
      "        \"system_fingerprint\": null\n",
      "      },\n",
      "      \"tool_calls\": [],\n",
      "      \"tool_call_chunks\": [],\n",
      "      \"invalid_tool_calls\": [],\n",
      "      \"usage_metadata\": {\n",
      "        \"input_tokens\": 79,\n",
      "        \"output_tokens\": 21,\n",
      "        \"total_tokens\": 100\n",
      "      }\n",
      "    },\n",
      "    FunctionMessage {\n",
      "      \"content\": \"[{\\\"title\\\":\\\"Weather in San Francisco\\\",\\\"url\\\":\\\"https://www.weatherapi.com/\\\",\\\"content\\\":\\\"{'location': {'name': 'San Francisco', 'region': 'California', 'country': 'United States of America', 'lat': 37.78, 'lon': -122.42, 'tz_id': 'America/Los_Angeles', 'localtime_epoch': 1724098493, 'localtime': '2024-08-19 13:14'}, 'current': {'last_updated_epoch': 1724097600, 'last_updated': '2024-08-19 13:00', 'temp_c': 21.1, 'temp_f': 70.0, 'is_day': 1, 'condition': {'text': 'Sunny', 'icon': '//cdn.weatherapi.com/weather/64x64/day/113.png', 'code': 1000}, 'wind_mph': 9.4, 'wind_kph': 15.1, 'wind_degree': 250, 'wind_dir': 'WSW', 'pressure_mb': 1019.0, 'pressure_in': 30.08, 'precip_mm': 0.0, 'precip_in': 0.0, 'humidity': 64, 'cloud': 0, 'feelslike_c': 21.1, 'feelslike_f': 70.0, 'windchill_c': 17.7, 'windchill_f': 63.8, 'heatindex_c': 17.7, 'heatindex_f': 63.8, 'dewpoint_c': 10.7, 'dewpoint_f': 51.2, 'vis_km': 16.0, 'vis_miles': 9.0, 'uv': 5.0, 'gust_mph': 13.2, 'gust_kph': 21.2}}\\\",\\\"score\\\":0.9991679,\\\"raw_content\\\":null}]\",\n",
      "      \"name\": \"tavily_search_results_json\",\n",
      "      \"additional_kwargs\": {},\n",
      "      \"response_metadata\": {}\n",
      "    },\n",
      "    AIMessageChunk {\n",
      "      \"id\": \"chatcmpl-9y36FtclcqetcawFZmYH7rDvajQ7A\",\n",
      "      \"content\": \"The current weather in San Francisco is sunny with a temperature of 70.0°F (21.1°C). The wind is blowing at 15.1 kph from the WSW direction. The humidity is at 64%, and there is no precipitation.\",\n",
      "      \"additional_kwargs\": {},\n",
      "      \"response_metadata\": {\n",
      "        \"estimatedTokenUsage\": {\n",
      "          \"promptTokens\": 536,\n",
      "          \"completionTokens\": 53,\n",
      "          \"totalTokens\": 589\n",
      "        },\n",
      "        \"prompt\": 0,\n",
      "        \"completion\": 0,\n",
      "        \"finish_reason\": \"stop\",\n",
      "        \"system_fingerprint\": null\n",
      "      },\n",
      "      \"tool_calls\": [],\n",
      "      \"tool_call_chunks\": [],\n",
      "      \"invalid_tool_calls\": [],\n",
      "      \"usage_metadata\": {\n",
      "        \"input_tokens\": 538,\n",
      "        \"output_tokens\": 54,\n",
      "        \"total_tokens\": 592\n",
      "      }\n",
      "    }\n",
      "  ]\n",
      "}\n"
     ]
    }
   ],
   "source": [
    "import { HumanMessage } from \"@langchain/core/messages\";\n",
    "\n",
    "const inputs = {\n",
    "  messages: [new HumanMessage(\"what is the weather in sf\")],\n",
    "};\n",
    "await app.invoke(inputs);"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5a9e8155-70c5-4973-912c-dc55104b2acf",
   "metadata": {},
   "source": [
    "This may take a little bit - it's making a few calls behind the scenes. In order\n",
    "to start seeing some intermediate results as they happen, we can use streaming.\n",
    "See below for more information on that.\n",
    "\n",
    "## Streaming\n",
    "\n",
    "LangGraph has support for several different types of streaming.\n",
    "\n",
    "### Streaming Node Output\n",
    "\n",
    "One of the benefits of using LangGraph is that it is easy to stream output as\n",
    "it's produced by each node.\n",
    "\n",
    "In this example we'll re-use the `inputs` object from above."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "f544977e-31f7-41f0-88c4-ec9c27b8cecb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "output {\n",
      "  agent: {\n",
      "    messages: [\n",
      "      AIMessageChunk {\n",
      "        \"id\": \"chatcmpl-9y36G4P6hDihhZkOCW5T5bJWWNl0Z\",\n",
      "        \"content\": \"\",\n",
      "        \"additional_kwargs\": {\n",
      "          \"function_call\": {\n",
      "            \"name\": \"tavily_search_results_json\",\n",
      "            \"arguments\": \"{\\\"input\\\":\\\"weather in San Francisco\\\"}\"\n",
      "          }\n",
      "        },\n",
      "        \"response_metadata\": {\n",
      "          \"estimatedTokenUsage\": {\n",
      "            \"promptTokens\": 80,\n",
      "            \"completionTokens\": 21,\n",
      "            \"totalTokens\": 101\n",
      "          },\n",
      "          \"prompt\": 0,\n",
      "          \"completion\": 0,\n",
      "          \"finish_reason\": \"function_call\",\n",
      "          \"system_fingerprint\": null\n",
      "        },\n",
      "        \"tool_calls\": [],\n",
      "        \"tool_call_chunks\": [],\n",
      "        \"invalid_tool_calls\": [],\n",
      "        \"usage_metadata\": {\n",
      "          \"input_tokens\": 79,\n",
      "          \"output_tokens\": 21,\n",
      "          \"total_tokens\": 100\n",
      "        }\n",
      "      }\n",
      "    ]\n",
      "  }\n",
      "}\n",
      "-----\n",
      "\n",
      "output {\n",
      "  action: {\n",
      "    messages: [\n",
      "      FunctionMessage {\n",
      "        \"content\": \"[{\\\"title\\\":\\\"Weather in San Francisco\\\",\\\"url\\\":\\\"https://www.weatherapi.com/\\\",\\\"content\\\":\\\"{'location': {'name': 'San Francisco', 'region': 'California', 'country': 'United States of America', 'lat': 37.78, 'lon': -122.42, 'tz_id': 'America/Los_Angeles', 'localtime_epoch': 1724098493, 'localtime': '2024-08-19 13:14'}, 'current': {'last_updated_epoch': 1724097600, 'last_updated': '2024-08-19 13:00', 'temp_c': 21.1, 'temp_f': 70.0, 'is_day': 1, 'condition': {'text': 'Sunny', 'icon': '//cdn.weatherapi.com/weather/64x64/day/113.png', 'code': 1000}, 'wind_mph': 9.4, 'wind_kph': 15.1, 'wind_degree': 250, 'wind_dir': 'WSW', 'pressure_mb': 1019.0, 'pressure_in': 30.08, 'precip_mm': 0.0, 'precip_in': 0.0, 'humidity': 64, 'cloud': 0, 'feelslike_c': 21.1, 'feelslike_f': 70.0, 'windchill_c': 17.7, 'windchill_f': 63.8, 'heatindex_c': 17.7, 'heatindex_f': 63.8, 'dewpoint_c': 10.7, 'dewpoint_f': 51.2, 'vis_km': 16.0, 'vis_miles': 9.0, 'uv': 5.0, 'gust_mph': 13.2, 'gust_kph': 21.2}}\\\",\\\"score\\\":0.9991846,\\\"raw_content\\\":null}]\",\n",
      "        \"name\": \"tavily_search_results_json\",\n",
      "        \"additional_kwargs\": {},\n",
      "        \"response_metadata\": {}\n",
      "      }\n",
      "    ]\n",
      "  }\n",
      "}\n",
      "-----\n",
      "\n",
      "output {\n",
      "  agent: {\n",
      "    messages: [\n",
      "      AIMessageChunk {\n",
      "        \"id\": \"chatcmpl-9y36KCh1ZZbMNXVbLxTzz8jZb4t4T\",\n",
      "        \"content\": \"The current weather in San Francisco is sunny with a temperature of 70.0°F (21.1°C). The wind is blowing at 15.1 kph from the WSW direction. The humidity is at 64% and there is no precipitation.\",\n",
      "        \"additional_kwargs\": {},\n",
      "        \"response_metadata\": {\n",
      "          \"estimatedTokenUsage\": {\n",
      "            \"promptTokens\": 536,\n",
      "            \"completionTokens\": 53,\n",
      "            \"totalTokens\": 589\n",
      "          },\n",
      "          \"prompt\": 0,\n",
      "          \"completion\": 0,\n",
      "          \"finish_reason\": \"stop\",\n",
      "          \"system_fingerprint\": null\n",
      "        },\n",
      "        \"tool_calls\": [],\n",
      "        \"tool_call_chunks\": [],\n",
      "        \"invalid_tool_calls\": [],\n",
      "        \"usage_metadata\": {\n",
      "          \"input_tokens\": 538,\n",
      "          \"output_tokens\": 54,\n",
      "          \"total_tokens\": 592\n",
      "        }\n",
      "      }\n",
      "    ]\n",
      "  }\n",
      "}\n",
      "-----\n",
      "\n"
     ]
    }
   ],
   "source": [
    "for await (const output of await app.stream(inputs)) {\n",
    "  console.log(\"output\", output);\n",
    "  console.log(\"-----\\n\");\n",
    "}"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "TypeScript",
   "language": "typescript",
   "name": "tslab"
  },
  "language_info": {
   "codemirror_mode": {
    "mode": "typescript",
    "name": "javascript",
    "typescript": true
   },
   "file_extension": ".ts",
   "mimetype": "text/typescript",
   "name": "typescript",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
